const responseTimeFactory = () => (500 * Math.random() + 100) // 100 - 500 ms

export const mockRequest = ({ responseData, code, message }, method, apiName, url, data, config) => {
  return new Promise((resolve, reject) => {
    const delayTime = responseTimeFactory()
    setTimeout(() => {
      const response = { code, data: responseData, message }
      console.log('返回', response)
      console.log('返回延时:', delayTime)
      resolve(response)
    }, delayTime)
  })
}
